<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>媒体查询</title>
    <style>
        @media only screen and (min-width:800px) and (max-width:1200px) {
            .d1{
                background-color: orange;
            }
        }
        @media only screen and(min-width:400px) and (max-width:799px) {
            .d1{
                background-color: red;
            }
        }
        @media only screen and(min-width:100px) and (max-width:399px) {
            .d1{
                background-color: orange;
            }
        }
        .d1{
            width: 100%;
            height: 100px;
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <div class="d1"></div>
</body>
</html>